package com.hdyg.sixg.adapter;

import android.support.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hdyg.sixg.R;
import com.hdyg.sixg.entry.CurrentMoneyBean;
import java.util.List;

/**
 * @author CZB
 * @describe 流通钱包适配器
 * @time 2019/3/20 14:22
 */
public class CurrentMoneyAdapter extends BaseQuickAdapter<CurrentMoneyBean.ListBean, BaseViewHolder> {
    public CurrentMoneyAdapter(int layoutResId, @Nullable List<CurrentMoneyBean.ListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, CurrentMoneyBean.ListBean item) {
        helper.setText(R.id.tv_left_top,item.getEvent_type());
        helper.setText(R.id.tv_left_bottom,item.getCreated_at());
        helper.setText(R.id.tv_right_center,item.getAmount());
        if ("1".equals(item.getPay_type())){
            //收入
            helper.setTextColor(R.id.tv_right_center,mContext.getResources().getColor(R.color.main_color));
        }else if ("2".equals(item.getPay_type())){
            //支出
            helper.setTextColor(R.id.tv_right_center,mContext.getResources().getColor(R.color.yellow_FFAB3D));
        }
    }
}
